package cn.middle.application.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.middle.common.base.mapper.BaseMapper;
import com.middle.common.base.service.impl.BaseServiceImpl;
import com.middle.common.result.Page;

import cn.middle.application.entity.Park;
import cn.middle.application.mapper.ParkMapper;
import cn.middle.application.service.ParkService;


@Service
public class ParkServiceImpl extends BaseServiceImpl<Park> implements ParkService {
	
	@Autowired
	private ParkMapper mapper;
	
	@Override
	public BaseMapper<Park> getDao() {
		return mapper;
	}

	@Override
	public Page<Park> listConditions(int page, int pageSize, String parkCode, String parkName) {
		PageHelper.startPage(page,pageSize);
		List<Park> parks = mapper.listConditions(parkCode, parkName);
		return new Page<>(new PageInfo<>(parks));
	}

	@Override
	public Park byParkCode(String code) {
		return mapper.byParkCode(code);
	}

	@Override
	public List<Park> byParkCodes(List<String> codes) {
		return mapper.byParkCodes(codes);
	}

}
